<?php

class dbModel extends Model{
var $table = 'geeks';
var $id = 'idGeek';
	function insert(){
	$tab = array();
	$file = fopen('listeIUT.txt', 'r');
			while (!feof($file)) {
			$page = '';
			$page = fgets($file, 4096);
			list($nom, $prenom) = explode(' ', $page);

			echo $nom." ".$prenom."<br/>";
			$tab['nom'] = $nom;
			$tab['prenom'] = $prenom;
			$this->save($tab);
			}
			
		}

	function readFile(){
		$file = fopen('listeIUT.txt', 'r');
		$string = 'a';
			while (!feof($file)) {
				$page = '';
				$page .= fgets($file, 4096);
				echo $page;
				/*$page = str_replace(' ', ':', $page)
				list($nom, $prenom) = explode(':', $page);
				$string .= $nom." ".$prenom."<br/>";*/
			}

		fclose($file);
		return $string;
	
	/*return 'fuck';*/

	}

	function getGeeks() {
		return $this->find();
	}
}

?>